package com.sojson.util.bean;

import com.sojson.base.impl.BaseUtilDto;
import com.sojson.config.exception.bean.Status;
import com.sojson.util.StringUtil;

import io.swagger.annotations.ApiModelProperty;

/**
 * 第三方用户Bean对象
 * 
 * @author liu
 * @date 2020-09-03
 */
public class OtherUser extends BaseUtilDto {

    /***/
    private static final long serialVersionUID = -7097710922022163250L;

    @ApiModelProperty("会话密钥")
    private String unionidOpenid;
    @ApiModelProperty("用户的唯一标识(微信平台统一)")
    private String unionid;
    @ApiModelProperty("用户的唯一标识(微信单个Appid下获取到的统一)")
    private String openid;
    @ApiModelProperty("会话密钥")
    private String sessionKey;
    @ApiModelProperty("头像")
    private String headImg;
    @ApiModelProperty("昵称")
    private String nickname;
    @ApiModelProperty("性别(0:未知,1:男,2:女)")
    private Integer sex;
    @ApiModelProperty("省")
    private Integer province;
    @ApiModelProperty("市")
    private Integer city;
    @ApiModelProperty("区")
    private String area;
    /** 状态信息 */
    private Status status;

    public OtherUser() {}

    /**
     * 成功返回
     * @param code
     */
    public OtherUser(Integer code) {
        this(code, null);
    }

    /**
     * 返回失败
     * @param code
     * @param msg
     */
    public OtherUser(Integer code, String msg) {
        this(new Status(code, msg));
    }

    public OtherUser(Status status) {
        this.status = status;
    }

    /**
     * 获取用户的唯一标识
     * 
     * @return
     */
    public String getUnionidOpenid() {
        return unionidOpenid;
    }

    /**
     * 设置用户的唯一标识
     * 
     * @param unionidOpenid
     */
    public void setUnionidOpenid(String unionidOpenid) {
        this.unionidOpenid = unionidOpenid;
    }

    /**
     * 获取用户的唯一标识(微信平台统一)
     * 
     * @return
     */
    public String getUnionid() {
        return unionid;
    }

    /**
     * 设置用户的唯一标识(微信平台统一)
     * 
     * @param unionid
     */
    public void setUnionid(String unionid) {
        this.unionid = unionid;
        setUnionidOpenid(unionid);
    }

    /**
     * 获取用户的唯一标识(微信单个Appid下获取到的统一)
     * 
     * @return
     */
    public String getOpenid() {
        return openid;
    }

    /**
     * 设置用户的唯一标识(微信单个Appid下获取到的统一)
     * 
     * @param openid
     */
    public void setOpenid(String openid) {
        this.openid = openid;
        if (StringUtil.isBlankObject(getUnionidOpenid())) {
            setUnionidOpenid(openid);
        }
    }

    /**
     * 获取会话密钥
     * 
     * @return
     */
    public String getSessionKey() {
        return sessionKey;
    }

    /**
     * 设置会话密钥
     * 
     * @param sessionKey
     */
    public void setSessionKey(String sessionKey) {
        this.sessionKey = sessionKey;
    }

    /**
     * 获取头像
     * 
     * @return
     */
    public String getHeadImg() {
        return headImg;
    }

    /**
     * 设置头像
     * 
     * @param headImg
     */
    public void setHeadImg(String headImg) {
        this.headImg = headImg;
    }

    /**
     * 获取昵称
     * 
     * @return
     */
    public String getNickname() {
        return nickname;
    }

    /**
     * 设置昵称
     * 
     * @param nickname
     */
    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    /**
     * 获取性别(0:未知,1:男,2:女)
     * 
     * @return
     */
    public Integer getSex() {
        return sex;
    }

    /**
     * 设置性别(0:未知,1:男,2:女)
     * 
     * @param sex
     */
    public void setSex(Integer sex) {
        this.sex = sex;
    }

    /**
     * 获取省
     * 
     * @return
     */
    public Integer getProvince() {
        return province;
    }

    /**
     * 设置省
     * 
     * @param province
     */
    public void setProvince(Integer province) {
        this.province = province;
    }

    /**
     * 获取市
     * 
     * @return
     */
    public Integer getCity() {
        return city;
    }

    /**
     * 设置市
     * 
     * @param city
     */
    public void setCity(Integer city) {
        this.city = city;
    }

    /**
     * 获取区
     * 
     * @return
     */
    public String getArea() {
        return area;
    }

    /**
     * 设置区
     * 
     * @param area
     */
    public void setArea(String area) {
        this.area = area;
    }

    /**
     * 获取状态信息
     * 
     * @return
     */
    public Status getStatus() {
        return status;
    }

    /**
     * 设置状态信息
     * 
     * @param status
     */
    public void setStatus(Status status) {
        this.status = status;
    }

}